package com.mingyuan.library.domain.lending.patron.model.valueobject;

import com.mingyuan.library.domain.common.model.ValueObject;
import com.mingyuan.library.domain.lending.patron.enums.PatronType;
import lombok.Data;
import lombok.NonNull;

import java.io.Serializable;

import static com.mingyuan.library.domain.lending.patron.enums.PatronType.Regular;

/**
 * 读者档案
 *
 * @author yangzk
 * @date 2023/12/28 19:03
 **/
@Data
@ValueObject
public class PatronInformation implements Serializable {
    private static final long serialVersionUID = 1540428279761544097L;
    /**
     * 读者ID
     */
    @NonNull PatronId patronId;
    /**
     * 读者类型
     */
    @NonNull PatronType type;

    /**
     * 是否普通读者
     *
     * @author yangzk
     * @date 2023/12/28 19:04
     **/
   public boolean isRegular() {
        return type.equals(Regular);
    }
}

